import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

// 设定路由的名字，一定要填写不然使用<keep-alive>时会出现各种问题

const routes = [
  {
    path: '/index', //首页
    name: 'Index',
    component: () => import('@/views/home/index.vue'),
    meta: {
      anon: false
    }
  },
  {
    path: '/detail', // 详情页
    name: 'detail',
    component: () => import('@/views/detail')
  },
  {
    path: '/change-tactics', // 策略调整
    name: 'change-tactics',
    component: () => import('@/views/change-tactics')
  },
  {
    path: '/',
    redirect: 'index'
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
